Magnetic field sensor to detect speed of angular rotation of a rotating magnetic structure, direction of the rotating magnetic structure or fault

ABSTRACT

In one aspect, an integrated circuit (IC) includes a magnetic field sensor to detect speed and direction of angular rotation of a rotating magnetic structure. The magnetic field sensor includes at least two magnetic field sensing elements configured to sense changes in a magnetic field caused by rotation of the magnetic structure. The IC also includes an output port configured to provide an output signal of the magnetic field sensor. The output signal indicates the speed and one of the direction or a fault.

BACKGROUND

Traditionally, a Hall effect sensor with two Hall elements and with dual outputs in quadrature will switch on or off in the presence or absence of a magnetic field of sufficient strength to provide rotational speed and rotational direction information. The lead or lag switching of either Hall element, compared to the other Hall element is used to determine the direction rotation of a ring magnet. In common solutions that employ speed and direction sensing using Hall latches, two Hall sensor output nodes or signals are required (i.e., two Hall sensor outputs or one Hall sensor output and a direction signal).

SUMMARY

In one aspect, an integrated circuit (IC) includes a magnetic field sensor to detect speed and direction of angular rotation of a rotating magnetic structure. The magnetic field sensor includes at least two magnetic field sensing elements configured to sense changes in a magnetic field caused by rotation of the magnetic structure. The IC also includes an output port configured to provide an output signal of the magnetic field sensor. The output signal indicates the speed and one of the direction or a fault.

In another aspect, an IC includes a magnetic field sensor means to detect speed and direction of angular rotation of a rotating magnetic structure. The magnetic field sensor means includes a means to sense changes in a magnetic field caused by rotation of the magnetic structure. The IC also includes an output port configured to provide an output signal of the magnetic field sensor means. The output signal indicates the speed and one of the direction or a fault.

DESCRIPTION OF THE DRAWINGS

FIG. 1A is a block diagram of an example of an integrated circuit (IC) and a rotating magnetic structure.

FIG. 1B is diagram of an example of the rotating magnetic structure.

FIG. 2 is a graph of an example of an output signal of the IC of FIG. 1.

FIG. 3 is block diagram of an example of a magnetic field sensor.

FIG. 4A are waveforms of examples of outputs of two magnetic field sensing elements.

FIG. 4B are waveforms of examples of outputs of two magnetic field sensing elements after a respective converter.

FIG. 5 is block diagram of an example of a frequency-locked loop (FLL).

FIG. 6 is block diagram of an example of output current circuitry.

FIG. 7 is a logic diagram of an example of a decoder.

FIG. 8A is block diagram of an example of a voltage regulator.

FIG. 8B is circuit diagram of an example of a two-wire circuitry.

FIG. 9 is a logic diagram of an example of a frequency detector.

FIG. 10 is circuit diagram of an example of a charge pump and a filter.

FIG. 11 is a graph of examples of waveforms of signals used in FIGS. 9 and 10.

FIG. 12A is a block diagram of another example of the magnetic field sensor.

FIG. 12B is a graph of an example of frequency of an output signal to the magnetic field sensor of FIG. 12A.

FIG. 13 is a diagram of another example of output current circuitry.

FIG. 14 is a table of example responses to select control signals for an analog multiplexor.

FIG. 15A is a logic diagram of an example of an analog multiplexor input select control receiving two control signals.

FIG. 15B is a circuit diagram of an example of a fault voltage block.

FIG. 15C is a logic diagram of an example of an analog multiplexor.

FIG. 15D is a table of example select control signals to an analog multiplexor.

FIG. 16 is a graph of further example of an output signal to the IC of FIG. 1.

FIG. 17 is block diagram of a further example of an output current circuitry.

FIG. 18 is a logic diagram of an example of a decoder.

FIG. 19 is a circuit diagram of a further example of two-wire circuitry.

FIG. 20 is a graph of an example of frequency of an output signal of a magnetic field sensor of FIG. 21.

FIGS. 21 to 24 are block diagrams of a still further example of the magnetic field sensor.

FIG. 25 is a logic diagram of an example of an analog multiplexor input select control receiving three control signals.

FIG. 26 is a table of example responses to select control signals for an analog multiplexor.

FIG. 27 is a graph of an example of duty cycle of a pulse width modulation (PWM) output of a magnetic field sensor of FIG. 28.

FIG. 28 is a block diagram of another example of a magnetic sensor.

FIG. 29 is a flowchart of an example of a process to generate a PWM output.

FIG. 30 is a block diagram of an example of digital circuitry to perform the process in FIG. 29.

DETAIL DESCRIPTION

Described herein are techniques to provide a signal indicating a speed of a rotating magnetic structure, a direction of angular rotation of the magnetic structure and/or one or more faults. Unlike traditional sensors, the sensor described herein provides the speed of the rotating magnetic structure, the direction of angular rotation of the magnetic structure and/or the one or more faults using a two-wire output.

As used herein, the term “magnetic field sensor” is used to describe a circuit that uses a magnetic field sensing element, generally in combination with other circuits. Magnetic field sensors are used in a variety of applications, including, but not limited to, an angle sensor that senses an angle of a direction of a magnetic field, a current sensor that senses a magnetic field generated by a current carried by a current-carrying conductor, a magnetic switch that senses the proximity of a ferromagnetic object, a rotation detector that senses passing ferromagnetic articles, for example, magnetic domains of a ring magnet or a ferromagnetic target (e.g., gear teeth) where the magnetic field sensor is used in combination with a back-biased or other magnet, and a magnetic field sensor that senses a magnetic field density of a magnetic field.

As used herein, the term “magnetic field sensing element” is used to describe a variety of electronic elements that can sense a magnetic field. The magnetic field sensing element can be, but is not limited to, a Hall effect element, a magnetoresistance element, or a magnetotransistor. As is known, there are different types of Hall effect elements, for example, a planar Hall element, a vertical Hall element, and a Circular Vertical Hall (CVH) element. As is also known, there are different types of magnetoresistance elements, for example, a semiconductor magnetoresistance element such as Indium Antimonide (InSb), a giant magnetoresistance (GMR) element, for example, a spin valve, an anisotropic magnetoresistance element (AMR), a tunneling magnetoresistance (TMR) element, and a magnetic tunnel junction (MTJ). The magnetic field sensing element may be a single element or, alternatively, may include two or more magnetic field sensing elements arranged in various configurations, e.g., a half bridge or full (Wheatstone) bridge. Depending on the device type and other application requirements, the magnetic field sensing element may be a device made of a type IV semiconductor material such as Silicon (Si) or Germanium (Ge), or a type III-V semiconductor material like Gallium-Arsenide (GaAs) or an Indium compound, e.g., Indium-Antimonide (InSb).

As is known, some of the above-described magnetic field sensing elements tend to have an axis of maximum sensitivity parallel to a substrate that supports the magnetic field sensing element, and others of the above-described magnetic field sensing elements tend to have an axis of maximum sensitivity perpendicular to a substrate that supports the magnetic field sensing element. In particular, planar Hall elements tend to have axes of sensitivity perpendicular to a substrate, while metal based or metallic magnetoresistance elements (e.g., GMR, TMR, AMR) and vertical Hall elements tend to have axes of sensitivity parallel to a substrate.

As used herein, a fault may include any condition that identifies an error or diagnostic condition. A fault may include but is not limited to a loose wire, a temperature of an integrated circuit being too hot or too cold, an air gap between a magnet and a sensor being too big or too small, a component (e.g., an oscillator, a regulator and so forth) performing out of specification.

Referring to FIGS. 1A and 1B, an example of an integrated circuit (IC) to detect speed and direction of angular rotation of a rotating magnetic structure is an IC 120. The IC 120 includes a magnetic field sensor 130 that detects a speed and a direction of angular rotation of a rotating magnetic structure 140 and provides an output signal 160 indicating the speed of the rotating magnetic structure 140, the direction of angular rotation of the magnetic structure 140 and/or one or more faults. In one example, a rotating magnetic structure 140 is a ring magnet 140′.

Referring to FIG. 2, in one example, the output signal 160 of the IC 120 may be an output current signal, Iout 160′ which indicates the speed of the rotating magnetic structure 140 and the direction of angular rotation of the magnetic structure 140. In one example, the Iout 160′ is a current signal that may be at one of four current levels, I_(CC1), I_(CC2), I_(CC3) and I_(CC4). In one example, when the Iout 160′ alternates between I_(CC2) and I_(CC3), the rotating magnetic structure 140 is moving in direction 1 (e.g., either clockwise or counter clockwise) and when the Iout 160′ alternates between I_(CC1) and I_(CC4), the rotating magnetic structure 140 is moving in direction 2, opposite direction 1. The faster the Iout 160′ transitions between I_(CC2) and I_(CC3) (i.e., frequency) or the faster the Iout 160′ transitions between I_(CC1) and I_(CC4) (i.e., frequency) the faster the speed the magnetic rotating structure 140 is turning.

Referring to FIG. 3, one example of the magnetic field sensor 130 is a magnetic field sensor 130′. The magnetic field sensor 130′ includes a magnetic field sensing element 302 a, a magnetic field sensing element 302 b, a converter 308 a, a converter 308 b, a digital processing circuitry 312, an output current circuitry 318 and a frequency-locked loop (FLL) 320.

The magnetic field sensing element 302 a sends an analog signal 322 a based on the magnetic field sensed from the rotating magnetic structure 140 to the converter 308 a, which provides a digital signal 332 a to the digital processing circuitry 312 and the FLL 320. As used herein, these components are part of a Channel A.

The magnetic field sensing element 302 b sends an analog signal 322 b based on the magnetic field sensed from the rotating magnetic structure 140 to the converter 308 b, which provides a digital signal 332 b to the digital processing circuitry 312 and the FLL 320. As used herein, these components are part of a Channel B.

FIG. 4A depicts an example of analog signals 322 a, 322 b. FIG. 4B depicts an example of digital signals 332 a, 332 b.

Referring back to FIG. 3, the digital processing circuitry 312 receives an output signal 360 from FLL 320 along with signals 332 a, 332 b and provides a direction signal, DIR, which indicates a direction of angular rotation of the rotating magnetic structure 140 and a signal, XOR to the output current circuitry 318. The output current circuitry 318 provides the IC output signal 160′.

In one example, the XOR signal is like an “edge stripped signal”, which for every rising and falling edge of a signal, the XOR signal has a rising edge that conveys the information that channel A or B signal changed state. In one embodiment, the XOR signal will have a state transition for every rising and falling edge of signal A and B. Every edge of signal A and B will cause the XOR signal to change state, so that the signal XOR is a logic signal that gives a summary of all the magnetic switchpoints of both logic signals/channels.

Referring to FIG. 5, an example of the FLL 320 is an FLL 320′. The FLL 320′ includes voltage-controlled oscillator (VCO) 518, which generated the output signal 360 as a frequency signal, VCO fout 360′. The FLL 320′ further includes a frequency detector 504 that receives the digital signal 332 a and the output signal 360 of the FLL 320′, a charge pump 510 and a filter 512. In one example, a signal provided by the filter 512 is a voltage signal Vfa. As described further herein, the voltage Vfa may be used in one or more embodiments (see, for example, FIG. 24).

Referring to FIG. 6, an example of the output current circuitry 318 is an output current circuitry 318′. The output current circuitry 318 includes a decoder 602 and two-wire circuitry 604. The decoder 602 receives the signal, VCO fout 360′, and the signal DIR. The decoder 602 provides one of four signals (e.g., a signal EN1, a signal EN2, a signal EN3 and a signal EN4) to the two-wire circuitry 604. Based on the signal received (i.e., either EN1, EN2, EN3 or EN4), the two-wire circuitry 604 generates the output signal 160′.

Referring to FIG. 7, an example of the decoder 602 (FIG. 6) is a decoder 602′. The decoder 602′ includes AND gates 702, 704, 706, 708. The AND gate 702 receives the VCO fout 360′ and the signal DIR and the AND gate 702 outputs the signal EN2.

The AND gate 704 receives an inverted signal of the VCO fout signal 360′, which is inverted by the inverter 716 and the signal DIR and the AND gate 704 outputs the signal EN3. When enabled signal EN1 or signal EN3 indicates a direction 1 rotation of the rotating magnet structure 140 (FIG. 1A).

The AND gate 706 receives the VCO fout 360′ and an inverted signal of the signal DIR, which is inverted by the inverter 714 and the AND gate 706 outputs the signal EN1. The AND gate 708 receives an inverted signal of the VCO fout signal 360′, which is inverted by the inverter 712 and the inverted signal of the signal DIR and the AND gate 708 outputs the signal EN4. When enabled, signal EN2 or signal EN4 indicates a direction 2 rotation of the rotating magnet structure 140 (FIG. 1A).

Referring to FIGS. 8A and 8B, a regulator 522 provides a regulated voltage, Vreg from a supply voltage Vcc. An example of a two-wire circuitry 604 is the two-wire circuitry 604′. The two-circuitry includes switches 802, 804, 806, 808 that form a voltage divider with resistors R₁, R₂, R₃, which provides a signal 820 to a first terminal of an operational amplifier 712. The amplifier 712 h provides an output signal to a base of a transistor 716. In one example, the switch 802 is closed when enabled by the signal EN1, the switch 804 is closed when enabled by the signal EN2, the switch 806 is closed when enabled by the signal EN3 and the switch 808 is closed when enabled by the signal EN4. In one example, only one of the signals EN1, EN2, EN3 or EN4 is enabled at a time.

The drain of the transistor is connected to a supply voltage Vcc and receives the output current Iout 160′. The drain of the transistor 716 is connected to a second terminal of the operational amplifier 712 and to a resistor R₄ and ground.

The current the signal 820 depends on which of the signals, EN1, EN2, EN3 or EN4 is enabled. In one particular example, when EN1 is enabled, the switch 802 is closed and a 15 mA current is supplied in the signal 820; when EN2 is enabled, the switch 804 is closed and a 11 mA current is supplied in signal 820; when EN3 is enabled, the switch 806 is closed and a 4 mA current is supplied in the signal 820; and when EN4 is enabled, the switch 808 is closed and no current is supplied in the signal 820.

Referring to FIG. 9, one example of the frequency detector 504 is a frequency detector 504′. The frequency detector 504′ includes a flip-flop 906 that receives a clock signal, Fin and a flip-flop 908 that receives a clock signal, Fout.

A signal, UP is a first output of the flip-flop 906 and a first output of the frequency detector 504′. A signal DN is an output of the flip-flop 908. The signal DN is inverted by an inverter 912 to produce a second output signal, DNN of the frequency detector 504′.

The frequency detector 504′ also includes a NAND gate 910, which receives the signal DN as a first input and receives the signal UP as a second input to produce a signal RN. The signal, RN is provided to clear (CLR) inputs of the flip-flops 906, 908.

Referring to FIG. 10, in one example the charge pump 510 may be the charge pump 510′ and an example of the filter 512 is a filter 512′. The charge pump 510′ includes a current source 1002, NMOS transistors 1004, 1006, 1008, 1016 and PMOS transistors 1010, 1012, 1014. The current source 1002 is connected to the gates of the NMOS transistors 1004, 1006, 1008 and the drain of NMOS transistor 1004 at one end and to the sources of the PMOS transistors 1010, 1012 at the other end. The sources of the NMOS transistors 1004, 1106, 1008 are connected to ground.

The gates of the PMOS transistors 1010, 1012 are connected. The gate and drain of the PMOS transistor 1010 are tied to the drain of the NMOS transistor 1006. The drain of the PMOS transistor 1012 is connected to the source of the PMOS transistor 1014. The source of the NMOS transistor 1014 is connected to the drain of the NMOS transistor 1008.

The signal, DNN from the frequency detector 504′ is connected to the gate of the PMOS transistor 1014 and the signal, UP from the frequency detector 504′ is connected to the gate of the NMOS transistor 1016. The drain of the PMOS transistor 1014 is connected to the drain of the NMOS transistor 1016, which provides a signal 1018 to the filter 512′.

The filter 512′ includes an operational amplifier 1020 that receives the signal 1018 from the charge pump 510′ at a first input and a second input of the operational amplifier 1020 is connected to ground. The filter 512′ include a capacitor C₁ connected in parallel with a resistor R₅ and a capacitor C₂, which are connected in parallel with the operational amplifier 1020. The operational amplifier 1020 provides the signal Vfa to the VCO 518.

FIG. 11 includes example waveforms using the circuits described in FIGS. 9 and 10. For example, example waveforms of the signals Fin, Fout, UP, DN, RN and Vfa are signals are waveforms Fin 902, Fout 904, UP 914, DN 918, RN 922 and Vfa, respectively.

Referring to FIGS. 12A and 12B, another example of the magnetic sensor 130 is a magnetic field sensor 130″. The magnetic field sensor 130″ generates an output signal Iout 160″. The output signal Iout 160″ may be used to provide the angular direction of a rotating magnet structure 140 (FIG. 1A) and one of a speed of rotation of the rotating magnet structure 140 or a fault (e.g., a fault in the IC 120 (FIG. 1)). In one example, the output signal Iout 160″ may vary between four current levels (e.g., I_(CC1), I_(CC2), I_(CC3) or I_(CC4)). In one particular example, when the output signal Iout 160″ alternates between current levels I_(CC1), I_(CC4), may indicate that the rotating magnet 140 is rotating in a first direction (direction 1); and when the output current signal Iout 160″ alternates between current levels I_(CC2), I_(CC3), may indicate that the rotating magnet 140 is rotating in a second direction (direction 2) opposite the first direction.

In one example, a frequency of the output signal Iout 160″ between Fmax and Fmin correlates to the speed of rotation of the rotating magnet structure 140 (FIG. 1). A frequency of the output signal Iout 160″ above Fmax or below Fmin indicates that there is a fault. For example, the IC 120 is overheating.

In one example, the magnetic field sensor 130″ includes the magnetic field sensing elements 302 a, 302 b, the converters 308 a, 308 b, the digital processing circuitry 312 and the output current circuitry 318 similar to the magnetic field sensor 130′. In a further example, the magnetic field sensor 130″ also includes the frequency detector 504, the charge pump 510, the filter 512 and the VCO 518. An output of the VCO 518 is the VCO fout 360′.

Unlike magnetic field sensor 130′, magnetic field sensor 130″ further includes an analog multiplexor 516 between the filter 512 and the VCO 518. In one example, the analog multiplexor 516 is a 4:1 multiplexor having input ports A, B, C, D.

The filter 512 provides an output signal, filter out 528, to the port A of the analog multiplexor 516. The analog multiplexor 516 is also configured to receive signals from a fault voltage block 524 and an analog multiplexor input select control 526 and is further configured to provide an output signal, mux out 530, to the VCO 518.

For example, the fault voltage block 524 provides a signal, Vflow to the port B of the analog multiplexor 516 and a signal, Vfhi to the port C of the analog multiplexor 516. A signal, Vfmed is not provided to the analog multiplexor 516 in this embodiment. The analog multiplexor input select control 26 receives control signals, Fault Lo Freq and Fault hi Freq, and provides select control signals, S1 and S2, to the analog multiplexor 516. Which one of the signals at the ports A, B or C is selected depends on what the signals S1 and S2 are.

Referring to FIG. 13, an example of the output current circuitry 318 is an output current circuitry 318′. In one example, the output current circuitry 318′ includes a decoder 1302 and a two-wire circuitry 1304. In one example, the decoder 1302 is the same as the decoder 602′ (FIG. 7) and the two-wire circuitry 1304 is the same as the two-wire circuitry 604′ (FIG. 8) except the output signal is Iout 160″.

Referring to FIG. 14, a table 1400 illustrates one example of how the analog multiplexor 516 functions. If there is no fault (i.e., the frequency of output signal, Iout 160″ is between Fmin and Fmax), then the select control signals S1 and S2 are each ‘0’ and the signal, filter out 528 is selected from port A and provided to the VCO 518. If there is a fault in the low frequency (i.e., the frequency of output signal Iout 160″ is below Fmin), then the select control signals S1 and S2 are ‘0’ and ‘1’ respectively and the signal, Vflow is selected from port B and provided to the VCO 518. If there is a fault in the high frequency (i.e., the frequency of output signal Iout 160″ is above Fmax), then the select control signals S1 and S2 are ‘1’ and ‘0’ respectively and the signal, Vfhi is selected from port C and provided to the VCO 518.

Referring to FIG. 15A, one example of the analog multiplexor input select control 526 is an analog multiplexor input select control 526′. The analog multiplexor input select control 526′ includes AND gates 1502 and 1506. The AND gate 1502 receives the control signal, Fault hi Freq. The control signal, Fault Lo Freq, is inverted by the inverter 1512 and provided as an input to the AND 1502. The AND gate 1502 provides an output signal, which is the select control signal, S1.

The AND gate 1506 receives the control signal, Fault Lo Freq. The signal, Fault hi Freq, is inverted by the inverter 1516 and provided as an input to the AND 1506. The AND gate 1506 provides an output signal, which is the select control signal, S2.

Referring to FIG. 15B, one example of the fault voltage block 524 is a fault voltage block 524′. In one example, the fault voltage block 524′ is a voltage divider that includes resistors, R₆, R₇, R₈, R₉ connected in series with the voltage, Vreg, and ground. The signal, Vfhi is provided between the resistors R₆, R₇; the signal, Vfmed is provided between the resistors R₇, R₈; and the signal, Vflow is provided between the resistors R₈, R₉.

Referring to FIG. 15C, one example of the analog multiplexor 516 is an analog multiplexor 516′. The analog multiplexor input 516′ includes switches 1522, 1524, 1526, 1528 and AND gates 1530, 1532, 1534, 1536. The AND gate 1530 receives a signal S1N and a signal S2N to produce a signal SA. The signal S1N is provided by inverting the signal S1 using an inverter 1542 and the signal S2N is provided by inverting the select control signal S2 using an inverter 1544.

The AND gate 1532 receives the signal S1N and the select control signal S2 to produce a signal SB. The AND gate 1534 receives the select control signal S1 and the signal S2N to produce a signal SA. The AND gate 1536 receives the signal S1 and the select control signal S2 to produce a signal SD.

The signals SA, SB, SC, SC and SD are used to activate the switches 1522, 1524, 1526, 1528 respectively. If the switch 1522 is activated, a signal InA is provided as the output signal 530; if the switch 1524 is activated, a signal InB is provided as the output signal 530; if the switch 1526 is activated, a signal InC is provided as the output signal 530; if the switch 1528 is activated, a signal InD is provided as the output signal 530 as depicted in a table 1550 in FIG. 15D. In one particular example, the signal InA represents the signal filter out 528, the signal InB represents the signal Vflow and the signal InC represents the signal Vfhi.

Referring to FIGS. 16 and 17, in another embodiment, speed and direction as well as faults may be determined from an output signal, Iout 160′″. In this embodiment, the output signal Iout 160′″ may be one of six current levels: I_(CC1b), I_(CC2b), I_(CC3b), I_(CC4b), I_(CC5) and I_(CC6). For example, the waveform 1602 depicts the output signal Iout 160′″ alternating between I_(CC5) and I_(CC6). In this example, the rotating magnet structure 140 (FIG. 1) is rotating in a direction 2. The frequency of the alternating between I_(CC5) and I_(CC6) indicates the speed. There are no faults detected.

In another example, the waveform 1604 depicts the output signal, Iout 160′″ alternating between I_(CC3b) and I_(CC4b). In this example, the rotating magnet structure 140 (FIG. 1) is rotating in a direction 1 opposite direction 2. The frequency of the alternating between I_(CC3b) and I_(CC4b) indicates the speed of the rotating magnet structure 140. There are no faults detected.

In a further example, the waveform 1606 depicts the output signal, Iout 160′″ alternating between I_(CC1b) and I_(CC2b) when at least a fault condition exists. In this example, the rotating magnet structure 140 (FIG. 1) may be rotating in a direction 1 or a direction 2. The frequency of the alternating between I_(CC1b) and I_(CC2b) indicates the speed.

In one example, output current circuitry in this embodiment is output current circuitry 318′″, which includes a decoder 1702 and a two-wire block 1704. The decoder 1702 receives the signal, DIR, the VCO fout signal 360 and a fault signal 1750. In one example, the decoder 1702 provides one of six signals (signal EN1 b, signal EN2 b, signal EN3 b, signal EN4 b, signal EN5 and signal EN6) to the two-wire circuitry 1704. In one particular example, when the signal EN1 b is provided, the output signal Iout 160′″ is equal to the current level I_(CC1b); when the signal EN2 b is provided, the output signal Iout 160′″ is equal to the current level I_(CC2b); when the signal EN3 b is provided, the output signal Iout 160′″ is equal to the current level I_(CC3b); when the signal EN4 b is provided, the output signal Iout 160′″ is equal to the current level I_(CC4b); when the signal EN5 is provided, the output signal Iout 160′″ is equal to the current level I_(CC5); and when the signal EN6 is provided, the output signal Iout 160′″ is equal to the current level I_(CC6).

Referring to FIG. 18, one example of the decoder 1702 is a decoder 1702′. The decoder 1702′ includes an AND gate 1902, an AND gate 1904, an AND gate 1906, an AND gate 1908, an AND gate 1910, and an AND gate 1912. The AND gate 1902 receives the direction signal 344, the VCO fout signal 360 and an inverted signal of the fault signal 1750, which is inverted by the inverter 1924, to form the signal EN1 b. The AND gate 1904 receives the direction signal 344, an inverted signal of the VCO fout signal 360, which is inverted by an inverter 1922 and the inverted signal of the fault signal 1750, which is inverted by the inverter 1924 to form the signal EN2 b.

The AND gate 1906 receives the VCO fout signal 360 and the fault signal 1750 to form the signal EN5. The AND gate 1908 receives an inverted signal of the VCO fout signal 360, which is inverted by an inverter 1926 and the fault signal 1750 to form the signal EN6.

The AND gate 1910 receives an inverted signal of the signal DIR, which is inverted by an inverter 1930; the VCO fout signal 360 and an inverted signal of the fault signal 1750, which is inverted by the inverter 1928, to form the signal EN3 b. The AND gate 1912 receives the inverted signal of the signal DIR, which is inverted by the inverter 1930; an inverted signal of the VCO fout signal 360, which is inverted by an inverter 1932 and the inverted signal of the fault signal 1750, which is inverted by the inverter 1928, to form the signal EN4 b.

Referring to FIG. 19, an example of a two-wire circuitry 1704 is the two-wire circuitry 1704′. The two-wire circuitry 1704′ includes switches 1802, 1804, 8106, 1808, 1810, 1812 that form a voltage divider with resistors R₁₀, R₁₁, R₁₂, R₁₃, R₁₄, which provides a signal 1820 to a first terminal of an operational amplifier 712, which provides an output signal to a base of a transistor 716.

In one example, the switch 1802 is closed when enabled by the signal EN1 b, the switch 1804 is closed when enabled by the signal EN2 b, the switch 1806 is closed when enabled by the signal EN3 b, the switch 1808 is closed when enabled by the signal EN4 b, the switch 1810 is closed when enabled by the signal EN5, the switch 1812 is closed when enabled by the signal EN6. In one example, only one of the signals EN1 b, EN2 b, EN3 b, EN4 b, EN5, EN6 is enabled at a time.

Referring to FIG. 20, in a still further embodiment, the frequency of the output signal. Iout 160 (FIG. 1) may also be used to identify one or more faults. In one particular example, frequency between 0 and 200 Hz indicates a first fault 2002, a frequency between 10.2 kHz and 12.2 kHz indicates a second fault 2004 and a frequency between 22.2 kHz indicates a third fault 2006.

The frequency between 201 Hz and 10.19 kHz indicates that the rotating magnet is rotating in a first direction. The speed of the rotating magnet in the first direction is slower for frequencies near 10.19 kHz than for frequencies near 200 Hz.

The frequency 12.3 kHz to 22.1 kHz indicates that the rotating magnet is rotating in a second direction opposite the first direction. The speed of rotating magnet is slower for frequencies near 12.3 kHz than for frequencies near 22.1 kHz.

Referring to FIG. 21, a further example of a magnetic field sensor 130 (FIG. 1) is a magnetic field sensor 2130, which provides one or more faults, for example, as depicted in FIG. 20 by taking the frequency of the output signal, Iout 160″″. In one example, the magnetic field sensor 130″″ includes an output control digital multiplexor 2102 and a two-wire block 2104. The output control digital multiplexor 2102 signal receives a signal, Direction 1 2110 and a signal, Direction 2 2112 and selects which of the signals to output based on the signal, DIR as a signal 2114. The signal 2114 is sent to one of the ports of the two-wire block 2104 (e.g., port 2) and the signal 2114 is inverted by the inverter 2114 and sent to another port of the two-wire block 2104 (e.g., port 3).

Referring to FIG. 22, in order to produce the signal Direction 1 2110, the magnetic field sensor 2130 further includes similar components to the magnetic field sensor 130′ such as the magnetic field sensing elements 302 a, 302 b, the converters 308 a, 308 b, the digital processing circuitry 312 and the FLL 320. The output of the FLL 320 produces the signal, Direction 1 2110.

Referring to FIG. 23, in order to produce the signal Direction 2 2112, the magnetic field sensor 2130 further includes an analog multiplexor 2302, a VCO 2304 and an analog multiplexor input select control 2306. In one example, the analog multiplexor 2302 is the same as the analog multiplexor 516 (FIG. 12A). In another example, the analog multiplexor 2302 is the same as the analog multiplexor 516′ (FIG. 15C). The analog multiplexor 2302 receives the signal Vflow at a port A, the signal VFmed at a port B a signal Vdir2 at a port C and the signal Vfhi at a port D. The analog multiplexor input select control 2306 receives three control signal, Fault Lo, Fault Med and Fault Hi to determine the select control signals S1 and S2.

The analog multiplexor 2302 receives select control signals, S1 and S2, from the analog multiplexor input select control 2306 then selects which signal received at the ports A, B, C or D is sent to the VCO 2304.

In one example, the signals Vflow, Vfmed and Vfhi are generated using the fault voltage block 524′. In one example, the signal Vflow corresponds to the first fault 2002, the signal Vfmed corresponds to the second fault 2004 and Vfhi corresponds to the fault 2006.

Referring to FIG. 24, in order to form the signal Vdir2, the magnetic field sensor 130″″ further includes a frequency/voltage converter 2402 and an adder 2404. The signal Vfa (FIG. 5) is increased by a voltage corresponding to 10 kHz, for example, by the adder 2404 to form the signal Vdir2.

Referring to FIG. 25, an example of the analog multiplexor input select control 2306 is an analog multiplexor input select control 2306′. The analog multiplexor input select control 2306′ includes inverters 2502, 2504, 2506; an OR gates 2532; NOR gates 22512, 514, 2534 and an AND gate 2520.

The inverter 2502 inverts the control signal Fault (Lo freq) signal to form a signal XN. The inverter 2504 inverts the control signal Fault (Med freq) signal to form a signal YN. The inverter 2506 inverts the control signal Fault (hi freq) signal to form a signal ZN.

The NOR gate 2512 receives the control signal Fault (Lo freq) signal, the control signal Fault (Med freq) signal and the signal ZN. The NOR gate 2514 receives the control signal Fault (Med freq) signal and the control signal Fault (hi freq) signal. The AND gate receives signals, XN, YN and ZN.

The OR gate 2532 receives the outputs from the NOR gate 2512 and the AND gate 2520 to produce the select control signal S1. The NOR gate 2534 receives the outputs from the NOR gate 2514 and the AND gate 2520, and the control signal Fault (Lo freq) to produce the select control signal S2.

Referring to FIG. 26, a table 2600 illustrates one example of how the analog multiplexor 2302 functions. If there is a low frequency fault (e.g., a fault 2002 (FIG. 20), then the select control signals S1 and S2 are each ‘0’ and the signal, Vflow is selected from port A and provided to the VCO 2304. If there is a medium frequency fault (e.g., a fault 2004 (FIG. 20), then the select control signals S1 and S2 are ‘0’ and ‘1’ respectively and the signal, Vfmed is selected from port B and provided to the VCO 2304. If there is no fault, then the select control signals S1 and S2 are ‘1’ and ‘0’ respectively and the signal, Vfdir is selected from port C and provided to the VCO 2304. If there is a high frequency fault (e.g., a fault 2006 (FIG. 20), then the select control signals S1 and S2 are each ‘1’ and the signal, Vfhi is selected from port D and provided to the VCO 2304.

Referring to FIGS. 27 and 28, in a still further embodiment, a duty cycle of a pulse width modulation (PWM) output may be used to determine if a fault exists. In one particular example, a duty cycle between 1% to 10%, 40% to 60% and 90% to 99% may indicate that a fault exists. A duty cycle between 11% and 39% may indicate that the rotating magnetic structure 140 (FIG. 1) is rotating in a direction 1 and a duty cycle between 61% and 89% may indicate that the rotating magnetic structure 140 is rotating a direction 2 opposite the direction 1.

An example of the magnetic field sensor 130 in this embodiment is a magnetic field sensor 2830. Similar to the magnetic field sensor 130′, the magnetic field sensor 2830 includes the magnetic field sensing element 302 a and the converter 308 a that form the Channel A and includes the magnetic field sensing element 302 b and the converter 304 b that form the Channel B. The magnetic field sensor 2830 also includes a digital processing block 2806 that receives input from the Channels A and B and provides an output to a two-wire output current circuit 2808, which provides an IC output signal 2860 in the form of a PWM output.

Referring to FIG. 29, an example of a process to generate a PWM output is a process 2900. Process 2900 waits until a rising edge of channel A (2902) and counts clock edges until the next rising edge in Channel A (2908).

Process 2900 determines pulse width percentage based on clock edges determined (2912). For example, the total number of clock edges determined in processing block 2908 is converted to speed and the speed is used to determine a pulse width percentage. For example, speed in revolutions per minute (RPM) is equal to 60 seconds divided by the product of the number of clock edges times 1 microsecond. In one example, a lookup table or an equation may be used to determine the pulse width percentage using the speed. In one particular example, the carrier frequency is 1 kHz.

One example of a look-up table is:

Magnet target 1 uSec Clock Pulse width for Frequency Direction Duty cycle edges 1 kHz carrier 1 rpm Direction 1 10% 10,000,000 100 microSec 10K rpm ″ 40% 6000 400 microSec 1 rpm Direction 2 60% 10,000,000 600 microSec 10K rpm ″ 90% 6000 900 microSec

In a further example, an equation may be derived to represent the target speed and convert it to pulse width modulated duty cycle. In one particular example, using the assumptions that 1 RPM is 10% pulse width, and 10,000 RPM is 40% pulse width, the following equation may be used for direction 1: Direction 1 Pulse Width (in %)=(10+[Log₁₀(speed)*7.5])=(10+[Log₁₀(6E+07/Clks)*7.5]), where Clks equals to the number of clock edges determined in processing block 2912. For instance if speed is 1, then [Log₁₀(1) is 0, so Pulse Width is 10%. If speed is 10000, then Log₁₀(10000) is 4, so Pulse Width=(10+[4*7.5])=40.

For direction 2 with 60 to 90% pulse width, the equation would be: Direction 2 Pulse Width (in %)=(60+[Log 10(speed)*7.5])=(60+[Log 10(6E+07/Clks)*7.5]).

In other examples, a different equation may be derived for 0.1 or 0 RPM, or the definition of the pulse width for minimum speed (say 10.1%) and maximum speed pulse width of 39.9% may be changed.

Process 2900 updates the previous pulse width percentage with the new pulse width percentage (2918) and stores the pulse width percentage (2922). In one example, the pulse width percentage is a pulse width percentage 3020 stored in a non-volatile memory 3006 (FIG. 30). After processing block 2918, process 2900 also repeats processing blocks 2902, 2908, 2912, 2918.

Process 2900 generates an output for a period of time using the pulse width percentage stored (2926). For example, assuming a 1 kHz carrier, a 1,000 microsec output is started remaining high based on the store pulse width percentage and low for the remainder of the 1,000 microseconds.

Process 2900 repeats processing block 2926. For example, after the 1,000 microseconds in the previous example, process 2900 repeats processing block 2926 for the next 1,000 microseconds.

Referring to FIG. 30, an example of the digital processing circuitry 2806 is digital processing circuitry 2806′. The digital processing circuitry 2806′ includes a processor 3002, a volatile memory 3004 and a non-volatile memory 3006. Non-volatile memory 3006 includes an operating system 3016; data 3018, which includes the pulse width percentage 3020; and instructions 3012, which are executed out of volatile memory 3004 to perform all or part of process 2900.

The processes described herein (e.g., process 2900) are not limited to use with the hardware of FIG. 30; they may find applicability in any computing or processing environment and with any type of machine or set of machines that is capable of running a computer program. The processes described herein may be implemented in hardware, software, or a combination of the two. The processes described herein may be implemented in computer programs executed on programmable computers/machines that each includes a processor, a non-transitory machine-readable medium or other article of manufacture that is readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and one or more output devices. Program code may be applied to data entered using an input device to perform any of the processes described herein and to generate output information.

The processing blocks (for example, in the process 2900) associated with implementing the system may be performed by one or more programmable processors executing one or more computer programs to perform the functions of the system. All or part of the system may be implemented as, special purpose logic circuitry (e.g., an FPGA (field-programmable gate array) and/or an ASIC (application-specific integrated circuit)). All or part of the system may be implemented using electronic hardware circuitry that include electronic devices such as, for example, at least one of a processor, a memory, a programmable logic device or a logic gate.

The processes described herein are not limited to the specific examples described. For example, the process 2900 is not limited to the specific processing order of FIG. 29. Rather, any of the processing blocks of FIG. 29 may be re-ordered, combined or removed, performed in parallel or in serial, as necessary, to achieve the results set forth above.

Elements of different embodiments described herein may be combined to form other embodiments not specifically set forth above. Various elements, which are described in the context of a single embodiment, may also be provided separately or in any suitable subcombination. Other embodiments not specifically described herein are also within the scope of the following claims. 

What is claimed is:
 1. An integrated circuit (IC) comprising: a magnetic field sensor to detect speed and direction of angular rotation of a rotating magnetic structure, the magnetic field sensor comprising: at least two magnetic field sensing elements configured to sense changes in a magnetic field caused by rotation of the magnetic structure; an output port configured to provide an output signal of the magnetic field sensor, a frequency of the output signal indicating the speed, wherein the output signal at a first amplitude and at a second amplitude each indicates the magnetic structure rotating in a first direction, wherein the output signal at a third amplitude and at a fourth amplitude each indicates the magnetic structure rotating in a second direction opposite the first direction, and wherein the output signal at a fifth amplitude and at a sixth amplitude each indicates one or more faults.
 2. The IC of claim 1, wherein the output signal is a current signal.
 3. The IC of claim 1, wherein none of the first, second, third, fourth, fifth and sixth amplitudes are equal.
 4. The IC of claim 1, wherein the magnetic structure is a ring magnet.
 5. The IC of claim 1, wherein the fault indicating at least one of: a loose wire, malfunction of the IC, a gap between the magnetic structure and the IC being above or below a distance threshold or a temperature of the IC exceeds a temperature threshold.
 6. The IC of claim 1, wherein at least one of the at least two magnetic field sensing elements comprises at least one of a Hall effect element, a magnetoresistance element, or a magnetotransistor.
 7. The IC of claim 6, wherein the magnetoresistance element comprises at least one of a giant magnetoresistance (GMR) element, an anisotropic magnetoresistance element (AMR), a tunneling magnetoresistance (TMR) element, and a magnetic tunnel junction (MTJ).
 8. An integrated circuit (IC) comprising: a magnetic field sensor to detect speed and direction of angular rotation of a rotating magnetic structure, the magnetic field sensor comprising: at least two magnetic field sensing elements configured to sense changes in a magnetic field caused by rotation of the magnetic structure; an output port configured to provide an output signal of the magnetic field sensor, the output signal indicating the speed and one of the direction or a fault, wherein the magnetic sensor further comprises: a first converter configured to convert a first signal from a first magnetic field sensing element to a first digital signal; a second converter configured to convert a second signal from a second magnetic field sensing element to a second digital signal; direction detection circuitry configured to receive the first digital signal and the second digital signal and to provide a direction signal; a frequency locked loop configured to receive the first digital signal and to provide a frequency signal; a decoder to receive the direction signal and the frequency signal; and a two-wire circuit configured to receive six signals from the decoder and to provide the output signal.
 9. The IC of claim 8, wherein the two-wire circuit comprises: a voltage divider; and an operational amplifier coupled to the voltage divider, wherein the six signals are configured to enable gates in the voltage divider.
 10. The IC of claim 8, wherein the output signal is a current signal.
 11. An integrated circuit (IC) comprising: a magnetic field sensor means to detect speed and direction of angular rotation of a rotating magnetic structure, the magnetic field sensor means comprising: a means to sense changes in a magnetic field caused by rotation of the magnetic structure; an output port configured to provide an output signal of the magnetic field sensor means, wherein the output signal at a first amplitude and at a second amplitude each indicates the magnetic structure rotating in a first direction, wherein the output signal at a third amplitude and at a fourth amplitude each indicates the magnetic structure rotating in a second direction opposite the first direction, and wherein the output signal at a fifth amplitude and at a sixth amplitude each indicates one or more faults.
 12. The IC of claim 11, wherein the output signal is a current signal.
 13. The IC of claim 11, wherein none of the first, second, third, fourth, fifth and sixth amplitudes are equal.
 14. The IC of claim 11, wherein the magnetic structure is a ring magnet.
 15. The IC of claim 11, wherein the fault indicating at least one of: a loose wire, malfunction of the IC, a gap between the magnetic structure and the IC being above or below a distance threshold or a temperature of the IC exceeds a temperature threshold.
 16. An integrated circuit (IC) comprising: a magnetic field sensor means to detect speed and direction of angular rotation of a rotating magnetic structure, the magnetic field sensor means comprising: a means to sense changes in a magnetic field caused by rotation of the magnetic structure; an output port configured to provide an output signal of the magnetic field sensor means, the output signal indicating the speed and one of the direction or a fault, wherein the magnetic field sensor means further comprises: a first converter means to convert a first signal from a first magnetic field sensing means to a first digital signal; a second means to convert a second signal from a second magnetic field sensing means to a second digital signal; a direction detection means to receive the first digital signal and the second digital signal and to provide a direction signal; a frequency locked loop means to receive the first digital signal and to provide a frequency signal; a decoder means to receive the direction signal and the frequency signal; and a two-wire circuit means to receive six signals from the decoder and to provide the output signal.
 17. The IC of claim 16, wherein the two-wire circuit means comprises: a voltage divider; and an operational amplifier coupled to the voltage divider, wherein the six signals are configured to enable gates in the voltage divider.
 18. The IC of claim 16, wherein the output signal is a current signal.
 19. A magnetic field sensor comprising: at least two magnetic field sensing elements configured to sense changes in a magnetic field caused by rotation of a magnetic structure; an output port configured to provide an output signal of the magnetic field sensor, a frequency of the output signal indicates a speed of rotation of the magnetic structure, wherein the output signal at a first amplitude and at a second amplitude each indicates the magnetic structure rotating in a first direction, wherein the output signal at a third amplitude and at a fourth amplitude each indicates the magnetic structure rotating in a second direction opposite the first direction, and wherein the output signal at a fifth amplitude and at a sixth amplitude each indicates one or more faults.
 20. The magnetic field sensor of claim 19, wherein the output signal is a current signal.
 21. The magnetic field sensor of claim 19, wherein none of the first, second, third, fourth, fifth and sixth amplitudes are equal.
 22. The magnetic field sensor of claim 19, wherein the magnetic structure is a ring magnet.
 23. The magnetic field sensor of claim 19, wherein at least one of the at least two magnetic field sensing elements comprises at least one of a Hall effect element, a magnetoresistance element, or a magnetotransistor.
 24. The magnetic field sensor of claim 23, wherein the magnetoresistance element comprises at least one of a giant magnetoresistance (GMR) element, an anisotropic magnetoresistance element (AMR), a tunneling magnetoresistance (TMR) element, and a magnetic tunnel junction (MTJ). 